package homework.test1;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class ClientDemo1 {
    public static void main(String[] args) throws IOException {
        //1.客户端确定发送地址与端口
        Socket sk = new Socket("127.0.0.1",10001);

        //2.客户端发送
        OutputStream os = sk.getOutputStream();
        os.write("你好呀".getBytes());
        System.out.println("客户端：已发送");

        //释放
        os.close();
        sk.close();

    }
}
